﻿import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import ConfigElementType 1.0
import "qrc:/qmlComponents/ConfigManager"
import "qrc:/qmlComponents/AxisModulePos"
import "qrc:/qmlComponents/VisionViewer"
import "qrc:/qmlComponents/CustomizedUIElement/RowColumnSelectorView"

Item{
    ColumnLayout {
        spacing: 30
        RowLayout{
            RowColumnSelector{
                rowColInfo: ltRowColInfo
            }
            Button{
                text: qsTr("MoveToLensPrPos")
                onClicked: {
                    tem.runSingleCmd(pickArm, "moveToLensPrPos",
                                     [ltRowColInfo.unitRow, ltRowColInfo.unitColumn, ltRowColInfo.row, ltRowColInfo.column])
                    }
            }
        }

        RowLayout{

            SAxisModulePos{
                moduleName: "PickerZ2"
                posName: "LoadMaterialPos"
            }

            ColumnLayout{
                Button{
                    text: qsTr("Pick_Lens")
                    onClicked: {
                        tem.runSingleCmd(pickArm, "moveToPickLens",
                                         [ltRowColInfo.unitRow, ltRowColInfo.unitColumn, ltRowColInfo.row, ltRowColInfo.column])
                        }
                }
                Button{
                    text: qsTr("PlaceBackLens")
                    onClicked: {
                        tem.runSingleCmd(pickArm, "placeBackMaterial",[false])
                        }
                    }
                }

        }

        RowLayout{
            SAxisModulePos{
                moduleName: "PickArmY"
                posName: "PlaceLensPos"
            }

            SAxisModulePos{
                moduleName: "PickerZ2"
                posName: "PlaceLensPos"
            }

            Button{
                text: qsTr("Place_Lens")
                onClicked: {
                    tem.runSingleCmd(pickArm, "moveToPlaceLensToLut")
                }
            }

        }

        RowLayout{
            SAxisModulePos{
                moduleName: "PickArmY"
                posName: "PickNgLensPos"
            }

            SAxisModulePos{
                moduleName: "PickerZ2"
                posName: "PickNgLensPos"
            }

            ColumnLayout{
                Button{
                    text: qsTr("Get_NG_Lens")
                    onClicked: {
                        tem.runSingleCmd(pickArm, "moveToGetRejectLens")
                    }
                }

                Button{
                    text: qsTr("Place_NG_Lens")
                    onClicked: {
                        tem.runSingleCmd(pickArm, "moveToPlaceRejectLens",
                                         [ltRowColInfo.row, ltRowColInfo.column, ltRowColInfo.unitRow, ltRowColInfo.unitColumn])
                    }
                }
            }

        }
    }
}
